package org.example.j2024_11_28.controller;

import org.example.j2024_11_28.model.StudentInfo;
import org.example.j2024_11_28.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/stu")
public class StudentController {
    @Autowired
    private StudentService service ;
    @RequestMapping("/s1")
    public List<StudentInfo> s1(){
        return service.queryStudents();
    }
    @RequestMapping("/s2")
    public List<StudentInfo> s2(){
        return service.queryStudentForId(1);
    }
}
